@extends('Admin.base')

@section('content')
    <div class="layui-card">
        <div class="layui-card-header layuiadmin-card-header-auto">
            <h2>详情</h2>
        </div>
        <div class="layui-card-body">

                <div class="layui-row layui-col-space10 layui-form-item">
                    <div class="layui-col-lg12">
                        <label class="layui-form-label">用户名：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid">{{$data['username'] ?? ''}}</div>
                        </div>
                    </div>
                </div>

                <div class="layui-row layui-col-space10 layui-form-item">
                    <div class="layui-col-lg12">
                        <label class="layui-form-label">真实姓名：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid">{{$data['realname'] ?? ''}}</div>
                        </div>
                    </div>
                </div>

                <div class="layui-row layui-col-space10 layui-form-item">
                    <div class="layui-col-lg12">
                        <label class="layui-form-label">手机号：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid">{{$data['phone'] ?? ''}}</div>
                        </div>
                    </div>
                </div>

                <div class="layui-row layui-col-space10 layui-form-item">
                    <div class="layui-col-lg12">
                        <label class="layui-form-label">角色组：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid">
                             @foreach($roles as $item)
                                @if(isset($roleHasPermission->role_id)&&$item->id==$roleHasPermission->role_id)
                                    {{ $item->name }}@endif
                            @endforeach
                            </div>
                        </div>
                    </div>
                </div>

                @if($roleHasPermission->role_id != 1)
                <div class="layui-row layui-col-space10 layui-form-item">
                    <div class="layui-col-lg12">
                        <label class="layui-form-label">归属区域：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid">
                             @foreach($region as $item)
                                @if(isset($data['region'])&&$item->id==$data['region'])
                                    {{ $item->name }}@endif
                            @endforeach
                            </div>
                        </div>
                    </div>
                </div>
                @endif


                <div class="layui-row layui-col-space10 layui-form-item">
                    <div class="layui-col-lg12">
                        <label class="layui-form-label">状态：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid">
                                @if( $data['status'] == 1 )
                                    开启
                                @else
                                    关闭
                                @endif
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <a  class="layui-btn" href="/admin/adminer" >返 回</a>
                    </div>
                </div>
        </div>
    </div>
@endsection

